Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic refactor #3483

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Topic refactor #3483

merged 2 commits into from
Jul 29, 2024

Conversation

rob-maron
Copy link
Collaborator

@rob-maron rob-maron commented Jul 24, 2024

Closes #3485

This PR:

Refactors all networks to broadcast messages through Topics instead of a static list of all recipients. This will be needed to support users dynamically leaving and joining the network

This PR does not:

Make any breaking protocol changes

Key places to review:

libp2p_network.rs, memory_network.rs

Copy link
Collaborator

@bfish713 bfish713 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes to have broadcast da also accept a topic. Also given the calls to the network are already split, do we even need to pass a topic in as an argument to the connected network? Either way broadcast_message and broadcast_da_message should have the same signature, or be combined again

crates/hotshot/src/traits/networking/libp2p_network.rs Outdated Show resolved Hide resolved
Comment on lines 274 to 279
async fn broadcast_message(
&self,
message: Vec<u8>,
recipients: BTreeSet<K>,
topic: Topic,
broadcast_delay: BroadcastDelay,
) -> Result<(), NetworkError>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did broadcast DA not also change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DA broadcast is a direct send to all recipients instead of an actual broadcast

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove da_broadcast_message and conditionally on the topic have the DA specific logic when needed (as in Libp2p)

@rob-maron rob-maron requested a review from ss-es as a code owner July 26, 2024 14:57
@rob-maron rob-maron requested a review from bfish713 July 26, 2024 14:58
@rob-maron rob-maron merged commit 8ff7df8 into main Jul 29, 2024
36 checks passed
@rob-maron rob-maron deleted the rm/topic-refactor branch July 29, 2024 13:35
@rob-maron rob-maron restored the rm/topic-refactor branch July 29, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tech debt] Topic refactor
3 participants